package com.xinyue.user.service.Impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xinyue.user.dao.NewsMapper;
import com.xinyue.user.pojo.News;
import com.xinyue.user.service.NewsService;

@Service
public class NewsServiceImpl implements NewsService {

	@Autowired
	private NewsMapper newsMapper;
	
	@Override
	public int deleteByPrimaryKey(Integer id) throws Exception {
		return 0;
	}

	@Override
	public int insert(News record) throws Exception {
		return newsMapper.insert(record);
	}

	@Override
	public News selectByPrimaryKey(Integer id) throws Exception {
		return newsMapper.selectByPrimaryKey(id);
	}

	@Override
	public List<News> selectAll(Integer page,String city) throws Exception {
		return newsMapper.selectAll(page,city);
	}

	@Override
	public int updateByPrimaryKey(News record) throws Exception {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int updateLikes(Integer id) throws Exception {
		return newsMapper.updateLikes(id);
	}

	@Override
	public List<News> selectBysex(Integer page,Integer sex) throws Exception {
		return newsMapper.selectBysex(page, sex);
	}

}
